package com.example.mylogin.service.impl;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mylogin.entity.Person;
import com.example.mylogin.entity.User;
import com.example.mylogin.mapper.UserMapper;
import com.example.mylogin.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 功能描述：
 * </p>
 *
 * @author cui haida
 * @date 2025/06/05/22:12
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, Person> implements UserService{

    private final UserMapper userMapper;

    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public List<Person> getUserByCondition() {
        List<Person> list = list();
        return list;
    }

    @Override
    public List<Person> getUserByCondition2() {
        LambdaQueryWrapper<Person> wrapper = new LambdaQueryWrapper<>();
        wrapper.apply("logicDelete = 0 OR logicDelete = 1");
        return list(wrapper);
    }

    @Override
    public List<Person> getUserByCondition3() {
        return userMapper.getUserByCondition();
    }

    @Override
    public List<Person> getUserByCondition4() {
        return userMapper.getUserByCondition2();
    }
}
